Change signup success condition to response status#609
Conversation
❌ Deploy Preview for github-spy failed.
|
|
Warning Review limit reached
More reviews will be available in 36 minutes and 28 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe signup form's post-submission success handler now checks the HTTP response status code (201) to decide whether to redirect to login, instead of relying on a specific backend message string for this decision. ChangesSignup Success Navigation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🎉 Thank you @Vinuthnainti for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines
|
🎉🎉 Thank you for your contribution! Your PR #609 has been merged! 🎉🎉 |
Description
This PR improves signup success handling by replacing response message string comparison with an HTTP status code check.
Changes
Replaced:
if (response.data.message === "User created successfully") {
navigate("/login");
}
with:
if (response.status === 201) {
navigate("/login");
}
The previous implementation depended on an exact backend response message. If the message text changes in the future, successful signup could fail to redirect users to the login page.
Using the HTTP
201 Createdstatus code is more reliable and aligns with REST API conventions.Testing
Summary by CodeRabbit